using System.Collections;
namespace ntools.NetduinoGo.PlusModule.NetduinoGo.Framework
{
    public class FileEnumerator : IEnumerator
    {
        private byte instance;

        public FileEnumerator(byte instance)
        {
            this.instance = instance;
        }

        public object Current
        {
            get
            {
                return new string(System.Text.Encoding.UTF8.GetChars(Plus.Link.Call(Link.INSTANCE_ENUMERATOR, Link.COMMAND_ENUMERATOR_CURRENT, new byte[] { this.instance })));
            }
        }

        public bool MoveNext()
        {
            return (Plus.Link.Call(Link.INSTANCE_ENUMERATOR, Link.COMMAND_ENUMERATOR_MOVENEXT, new byte[] { this.instance })[0] == 1);
        }

        public void Reset()
        {
            Plus.Link.Call(Link.INSTANCE_ENUMERATOR, Link.COMMAND_ENUMERATOR_RESET, new byte[] { this.instance });
        }
    }
}
